<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>productModify.jsp</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="plugins/bootstrap/css/bootstrap.min.css"
	type="text/css"></link>
<link rel="stylesheet" href="plugins/FlatUI/dist/css/flat-ui.css"
	type="text/css"></link>
<link rel="shortcut icon" href="plugins/FlatUI/dist/img/favicon.ico">
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="js/jquery.js">
</script>
<script src="plugins/bootstrap/js/bootstrap.min.js">
</script>
<script type="text/javascript" src="plugins/FlatUI/dist/js/flat-ui.js">
</script>
<script type="text/javascript" src="plugins/fwb/bootstrap-wysiwyg.js">
</script>
<script src="plugins/fwb/external/jquery.hotkeys.js"
	type="text/javascript">
</script>
<script type="text/javascript" src="js/productAdd.js">
</script>
<script type="text/javascript"
	src="plugins/FlatUI/dist/js/application.js">
</script>
<script type="text/javascript">
	$(function() {
		$("form").submit(function() {
			$("#context").val($("#content").text());
			$("#contextHtml").val($("#content").html());
			if ($("#linkBackName").val() == "") {
				$("#linkBackNameResult").text("请填写新闻标题！");
				$("#linkBackNameResult").attr("style", "color:red");
				return false;
			} else if ($("#content").text() == "") {
				$("#contextResult").text("请填写产品正文信息！");
				$("#contextResult").attr("style", "color:red");
				return false;
			}
		});

		//失去焦点操作
		$("#linkBackName").blur(function() {
			if ($("#linkBackName").val() == "") {
				$("#linkBackNameResult").text("请填写新闻标题！");
				$("#linkBackNameResult").attr("style", "color:red");
				return;
			}
			$("#linkBackNameResult").text("");
		});


	})
</script>
</head>
<body style="padding: 5px 10px">
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title">融资产品修改</h3>
		</div>
		<div class="panel-body">
			<form class="form-horizontal" role="form"
				action="udateProduct.action" method="post">
				<div class="form-group">
					<label for="productID" class="col-lg-2 control-label"> 产品编号
					</label>
					<div class="col-lg-10">
						<input type="text" class="form-control" id="productID"
							name="productID" value="${product.productID }"
							readonly="readonly">
					</div>
				</div>
				<div class="form-group">
					<label for="productName" class="col-lg-2 control-label">
						产品名称 </label>
					<div class="col-lg-10">
						<input type="text" class="form-control" id="productName"
							name="productName" value="${product.productName }"
							placeholder="产品名称">
					</div>
				</div>
				<div class="form-group">
					<label for="productRate" class="col-lg-2 control-label">
						贷款利率 </label>
					<div class="col-lg-10">
						<div class="input-group col-lg-3" style="float: left;">
							<input type="text" class="form-control" name="loanMinRate"
								value="${product.loanMinRate }" placeholder="最低利率,不填默认为0">
							<span class="input-group-addon">%</span>
						</div>
						<div style="float: left; margin: 0 10px;">-----</div>
						<div class="input-group col-lg-4">
							<input type="text" class="form-control" name="loanMaxRate"
								value="${product.loanMaxRate }"
								placeholder="最高利率,可不填,不填认为利率为固定值"> <span
								class="input-group-addon">%</span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="company" class="col-lg-2 control-label"> 发行单位 </label>
					<div class="col-lg-10">
						<select data-toggle="select"
							class="form-control select select-default" name="companyID">
							<c:forEach items="${companyList}" var="company">
								<c:if test="${company.companyID == product.companyID }">
									<option selected="selected" value="${product.companyID }">${product.companyName }</option>
								</c:if>
								<c:if test="${company.companyID != product.companyID }">
									<option value="${company.companyID }">${company.companyName }</option>
								</c:if>

							</c:forEach>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="loansize" class="col-lg-2 control-label"> 贷款规模
					</label>
					<div class="col-lg-10">
						<div class="input-group col-lg-3" style="float: left;">
							<input type="text" class="form-control" id="loanMinScale"
								name="loanMinScale" value="${product.loanMinScale }"
								placeholder="最低贷款规模,不填默认为0"> <span
								class="input-group-addon">万</span>
						</div>
						<div style="float: left; margin: 0 10px;">-----</div>
						<div class="input-group col-lg-5">
							<input type="text" class="form-control" id="loanMaxScale"
								name="loanMaxScale" value="${product.loanMaxScale }"
								placeholder="最高贷款规模,可不填,不填认为贷款规模为固定值"> <span
								class="input-group-addon">万</span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="productType" class="col-lg-2 control-label">
						产品类型 </label>
					<div class="col-lg-10">
						<select data-toggle="select"
							class="form-control select select-default" name="productTypeID">
							<c:forEach items="${productTypeList}" var="productType">
								<c:if
									test="${product.productTypeID eq productType.productTypeID }">
									<option selected="selected"
										value="${productType.productTypeID }">${productType.productTypeName }</option>
								</c:if>
								<c:if
									test="${product.productTypeID != productType.productTypeID }">
									<option value="${productType.productTypeID }">${productType.productTypeName }</option>
								</c:if>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="productDuration" class="col-lg-2 control-label">
						贷款周期 </label>
					<div class="col-lg-10">
						<select data-toggle="select"
							class="form-control select select-default" name="loanPeriodID">
							<c:forEach items="${loanPeriodList}" var="loanPeriod">
								<c:if test="${loanPeriod.loanPeriodID == product.loanPeriodID}">
									<option value="${product.loanPeriodID }">${product.loanPeriodWeek }个月</option>
								</c:if>
								<c:if test="${loanPeriod.loanPeriodID != product.loanPeriodID}">
									<option value="${loanPeriod.loanPeriodID }">${loanPeriod.loanPeriodWeek }个月</option>
								</c:if>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="linkman" class="col-lg-2 control-label"> 联系人 </label>
					<div class="col-lg-10">
						<input type="text" class="form-control" id="linkPersonName"
							name="linkPersonName" value="${product.linkPersonName }"
							placeholder="联系人">
					</div>
				</div>
				<div class="form-group">
					<label for="bank" class="col-lg-2 control-label"> 联系银行 </label>
					<div class="col-lg-10">
						<input type="text" class="form-control" id="linkBackName"
							name="linkBackName" value="${product.linkBackName }"
							placeholder="联系银行">
					</div>
				</div>
				<div class="form-group">
					<label for="content" class="col-lg-2 control-label"> 内容 </label>
					<div class="col-lg-10">
						<!-- 			asdjalkj dlkajsdkl asjdlkaj sdkl asd -->
						<div class="btn-toolbar" data-role="editor-toolbar"
							data-target="#content">
							<div class="btn-group">
								<a class="btn" data-edit="bold" title="Bold (Ctrl/Cmd+B)"> <b>加粗</b>
								</a> <a class="btn" data-edit="italic" title="Italic (Ctrl/Cmd+I)">
									<i>倾斜</i>
								</a>
							</div>
							<div class="btn-group">
								<a class="btn" data-edit="insertunorderedlist"
									title="Bullet list"> 列表 </a> <a class="btn"
									data-edit="insertorderedlist" title="Number list"> 有序列表 </a> <a
									class="btn" data-edit="indent" title="Indent (Tab)"> Tab缩进
								</a>
							</div>
							<div class="btn-group">
								<a class="btn" data-edit="justifyleft"
									title="Align Left (Ctrl/Cmd+L)"> 左对齐 </a> <a class="btn"
									data-edit="justifycenter" title="Center (Ctrl/Cmd+E)"> 居中­
								</a> <a class="btn" data-edit="justifyright"
									title="Align Right (Ctrl/Cmd+R)"> 右对齐 </a> <a class="btn"
									data-edit="justifyfull" title="Justify (Ctrl/Cmd+J)"> 自动调整
								</a>
							</div>
							<div class="btn-group">
								<a class="btn" data-edit="undo" title="Undo (Ctrl/Cmd+Z)">
									撤销 </a> <a class="btn" data-edit="redo" title="Redo (Ctrl/Cmd+Y)">
									恢复 </a>
							</div>
						</div>
						<div id="content"
							style="overflow: scroll; max-height: 300px; border: 1px solid; height: 200px;">${product.contextHtml }</div>
					</div>
					<input type="hidden" id="context" name="context" /> <input
						type="hidden" id="contextHtml" name="contextHtml" />
				</div>
				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-10">
						<button type="submit" class="btn btn-lg btn-info"
							style="padding: 15px 60px; border-radius: 0px;">修改</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</body>
</html>
